/**
 * 流程设计 api 封装
 *
 * @Author:    ADog
 * @Date:      2025-10-06 20:16:41
 * @Copyright  1.0
 */
import { postRequest, getRequest, getImage } from '/@/lib/axios';

export const flowDeployApi = {

  /**
   * 分页查询  @author  ADog
   */
  queryMyTask : (param) => {
    return postRequest('/flw/instance/queryMyTask', param);
  },
  /**
   * 审批通过  @author  ADog
   */
  completeTask:(id) =>{
  return getRequest(`/flw/instance/completeTask/${id}`);
  },
  /**
   * 获取流程进度图
   * @param id procInsId 流程实例 ID
   * @returns {Promise<string>} 返回 Blob URL
   */
  downloadFlowActiveImg: (id) => {
    return getImage('flw/instance/downloadFlowActiveImg', { procId: id }).then(blob => {
      return URL.createObjectURL(blob);
    });
  }
};
